2022-10-14
2179
#react
Esteban Herrera
254
Oct 14, 2022 ⋅ 7 min read

Immutability in React: Should you mutate objects?

Esteban Herrera Family man. Java and JavaScript developer. Swift and VR/AR hobbyist. Like books, movies, and still trying many things. Find me at eherrera.net

Recent posts:

How To Create Heatmaps In Javascript: Exploring The Heat Js Library

How to create heatmaps in JavaScript: The Heat.js library

This tutorial will explore the application of heatmaps in JavaScript projects, focusing on how to use the Heat.js library to generate them.

Oghenetega Denedo
May 8, 2024 ⋅ 7 min read
Eleventy Adoption Guide: Overview, Examples, And Alternatives

Eleventy adoption guide: Overview, examples, and alternatives

Eleventy (11ty) is a compelling solution for developers seeking a straightforward, performance-oriented approach to static site generation.

Nelson Michael
May 7, 2024 ⋅ 8 min read
6 CSS Tools For More Efficient And Flexible CSS Handling

6 CSS tools for more efficient and flexible CSS handling

Explore some CSS tools that offer the perfect blend of efficiency and flexibility when handling CSS, such as styled-components and Emotion.

Fimber Elemuwa
May 7, 2024 ⋅ 7 min read
Leveraging React Server Components In Redwoodjs

Leveraging React Server Components in RedwoodJS

RedwoodJS announced support for server-side rendering and RSCs in its Bighorn release. Explore this feature for when it’s production-ready.

Stephan Miller
May 6, 2024 ⋅ 9 min read
View all posts

5 Replies to "Immutability in React: Should you mutate objects?"

  1. In JavaScript, strings are not arrays so you can do something like this:

    str[2] = ‘d’;

    But you cannot do this.

  2. Is there a missing “not” in this sentence: “In JavaScript, strings are not arrays so you can do something like this:

    str[2] = ‘d’;”

  3. In the above example, both references (str1 and str2) are equal because they point to the same object (‘abc’).

    I would change this phrase and also the image it is confusing… because in the end they are not pointing to the same object abc.. they have different values.. so no matter if you change str1 , str2 wont be affected. Because strings are primitive not references.. therefore there;s no pointing.

Leave a Reply